<html>
<head>
	<title>bannyUploader's demo</title>
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
	<script src="../lib/jslog.js" type="text/javascript"></script>
	<script src="../src/bannyUploader-compressed.js" type="text/javascript"></script>
	<script language="javascript">
	<!--
		var log = null;
		try { log = jslog; } catch(e) {}
		if(!log) {
			log = {
				info: function(msg) {},
				warn: function(msg) {},
				debug: function(msg) {},
				error: function(msg) {}
			};
		}
		
		function config() {
			banny_uploader.config({
				url: 'http://localhost:8080/upload.asp', // upload url that can handler post request. must set
				controller: '../build/bannyUploader.swf', // relative path or absolute path. optional, default is bannyUploader.swf
				filter: [{name: 'Image', value: '*.gif;*.jpg'}], // File filter when browse file, is object array. Optional.
				allowUI: true, // if the allowUI attribute set to false, the bannyUploader will generate 1px width and 1px height flash object. optional, default is false
				targetId: 'controller_cotainer' // optional, default is null
			});
			log.info("Get bannyUploader's url: " + bannyUploader_getUrl());
			
			log.info('Flash player version: ' + banny_uploader.getSwfVer());
			
			banny_uploader.onError = function(event) {// 'code' and 'message' attributes
				alert(event.message); // handler upload error.
			};
			banny_uploader.onProgress = function(event) { // 'bytesTotal' and 'bytesLoaded' attributes
				// handler progress of upload
			};
			banny_uploader.onComplete = function() {
				// handler upload complete
			};
			banny_uploader.onCompleteData = function(event) {
				// handler data that sends from server after upload complete.
				alert(event.data);
			};
			banny_uploader.onFileSelect = function(file) {
				// file select handler
				alert(file.name);
			}
		};
	-->
	</script>
	<style type="text/css">
		input {
			margin-top: 10px;
		}
	</style>
</head>
<body onload="log.debug(typeof(banny_uploader));config()" id="bannyBody">
<div id="controller_cotainer">
</div>
<div style="margin: 10px 10px 10px 300px">
	<input type="button" value="browse" onclick="banny_uploader.browse([{name: 'Image', value: '*.gif;*.jpg'}])" /><br />
	<input type="button" value="upload" onclick="banny_uploader.upload()" /><br />
	<input type="button" value="cancel" onclick="banny_uploader.cancel()" /><br />
</div>
</body>